<?php $url = new Url();?>
<link rel="stylesheet" type="text/css" href="<?=Yii::app()->params["urlRs"] ?>/js/colorbox/colorbox.css" media="all" /> 
<script  src="<?=Yii::app()->params["urlRs"] ?>/js/colorbox/jquery.colorbox.js" type="text/javascript"></script> 

<link type="text/css" href="<?=Yii::app()->params["urlRs"] ?>/js/jqueryui/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Yii::app()->params["urlRs"] ?>/js/jqueryui/jquery-ui-1.8.23.custom.min.js"></script>

<div id="main" class="nosidebar">                
    <div id="content">

        <h2>Tài chính</h2>

        <div class="flash notice" id="flash_notice" style="display: none;">Sửa giai đoạn thành công!</div>

        <div id="errorExplanation" style="display: none;">
            <ul id="err_msg">
                <!--<li>Tên không thể để trắng</li>
                <li>Mã nhận dạng không thể để trắng</li>
                <li>Mã nhận dạng quá ngắn (tối thiểu 1 ký tự)</li>-->
            </ul>
        </div>        

        <p>Số tiền còn lại : <a href="javascript:" id="project_remain"><?php echo number_format($data_project['project_remain']); ?></a></p>
        <div id="tab-content-versions" class="tab-content">        
            <table class="list versions">
                <thead>
                    <tr>
                        <th>Nội dung</th>
                        <th>Số tiền</th>
                        <th>Mô tả</th>                        
                        <th>Ngày tạo</th>                        
                        <th style="width:25%"></th>
                    </tr>
                </thead>
                <tbody>
                    <?php for($i=0;$i<count($data);$i++){?>
                        <tr class="version <?php if(($i%2) == 1){echo "even";}else{echo "odd";} ?> open" id="finance_row_<?php echo $data[$i]['finance_id']; ?>">
                            <td class="date"><a href="javascript:"><?php echo $data[$i]['finance_name']; ?></a></td>
                            <td class="date"><?php echo number_format($data[$i]['finance_spent']); ?></td>
                            <td class="date"><?php echo $data[$i]['finance_description'];?></td>                            
                            <td class="date"><?php echo date('d/m/Y',$data[$i]['finance_create_time']);?></td>                            
                            <td class="buttons">
                                <!--<a class="icon icon-edit" href="javascript:">Sửa</a>-->
                                <a rel="nofollow" data-method="delete" class="icon icon-del" href="javascript:" onclick="delete_finance(<?php echo $data[$i]['finance_id'];?>)">Xóa</a>
                            </td>
                        </tr>
                        <?php } ?>                
                </tbody>
            </table>                        
            <p><a class="icon icon-add" href="#popup_version" id="open_pop">Chi tiêu mới</a></p>
        </div>         

        <div style="clear:both;"></div>

        <div style="display: none;">
            <div id="popup_version" style="margin: 8px;">
                <h2>Chi tiêu mới</h2>
                <div class="box tabular">
                    <p><label for="version_name">Nội dung<span class="required"> *</span></label><input type="text" value="" name="version[name]" id="finance_name" style="width: 200px;"></p>
                    <p><label for="version_name">Chi tiêu<span class="required"> *</span></label><input type="text" value="" name="version[name]" id="finance_spent" style="width: 100px;"></p>
                    <p><label for="version_description">Mô tả</label><input type="text" value="" name="version[description]" id="finance_description" style="width: 300px;"></p>                    
                    <!--<p><label for="version_effective_date">Ngày</label><input type="text" name="version[effective_date]" id="create_date"></p>-->
                </div>
                <input type="button" value="Tạo" name="commit" onclick="add_finance()">
            </div>                     
        </div>

    </div>
</div>


<?php include "index.js.php"; ?>
